package stage
{
	/**
	 * This class is used to describe a sensor object
	 * @author power
	 */
	public class Sensor extends GameObject
	{
		
		public function Sensor(id:String)
		{
			super(id);
		}
		
		public var  alertState:Boolean=false;
		
		public function showSensor():void
		{
			changeGraphicsByState();
			super.startupGameObject(this.graphics,this.position);
		}
		
		override public function enterFrame(dt:Number):void
		{
			changeGraphicsByState();
			super.enterFrame(dt);
		}
		
		protected function changeGraphicsByState():void
		{
			if(!this.alertState)
			{
				this.graphics=ResourceManager.DisableSensorGraphics;
			}
			else
			{
				this.graphics=ResourceManager.EnableSensorGraphics;
			}
		}
		
	}
}